<?php
	//session_destroy();
	session_start();
	$_SESSION['value']="none";
	class EditLogManager{
	
		public function validate($str,$param1){
		
				if(is_numeric($param1)&&($str!=null||$str!="")&&(!is_numeric($param1))){
					return true;
				}else{
					return false;
				}
			}

		public function editCheckin($str,$param1){
		
			$conn = oci_connect("naiad", "1234", "localhost/XE");
			if((strcmp($str,"snum"))==0){
				$s = oci_parse($conn, "select STUDENTNO,TERM,DATE_IN,ROOMNO, NAMEFIRST, NAMEMIDDLE, NAMELAST  FROM CHECK_IN where STUDENTNO like '".$param1."'");
			}				
			
			oci_execute($s);
			$nrows = oci_fetch_all($s, $results);
			if($nrows!=0){
				$i = 0;
				$_SESSION['studentno']=$results['STUDENTNO'][$i];
				$_SESSION['term']=$results['TERM'][$i];
				$_SESSION['date_in']=$results['DATE_IN'][$i];
				$_SESSION['roomno']=$results['ROOMNO'][$i];
				$_SESSION['last']=$results['NAMELAST'][$i];
				$_SESSION['first']=$results['NAMEFIRST'][$i];
				$_SESSION['middle']=$results['NAMEMIDDLE'][$i];
				
				return 1;
			}else{
				return 0;
			}
			
		}//end of editStudentInfo function
	
		
		
	}//end of EditLogManager class

?>